﻿@model IEnumerable<DslamPort.Models.DslamPortModel>        
<!--Body-->
<div align="center">
    <h2>
        BÁO CÁO CHI TIẾT THUÊ BAO MYTV</h2>
        <h3>
            @ViewBag.name <text>&nbsp;(</text> @ViewBag.system_id <text>)</text>
        </h3>
</div>
<div class="container_12">
    <div class="grid_12">
        @if (TempData["msg"] != null)
        {                            
            <span class="notification n-success">@TempData["msg"]</span>
        }
        @if (TempData["error"] != null)
        {                            
            <span class="notification n-error">@TempData["error"]</span>
        }
        @using (Html.BeginForm("FindReport", "ReportMytv", FormMethod.Post, new { id = "FindReport", name = "FindReport" }))
        {
            
            <div class="bottom-spacing">
                <a href="@Url.Action("Export_Excel", "ReportMytv",new{type=1})">Export Excel</a>
            </div>
        }
        @using (Html.BeginForm("CheckedAction", "DslamPort", FormMethod.Post, new { id = "CheckedAction", name = "CheckedAction" }))
        {           
            <div class="module">
                <h2 align="right">
                <span><a href="@Url.Action("Index", "ReportMytv")">Quay lại</a></span></h2>
                <div class="module-table-body">
                    <div class="scrolling">
                        <div class="data-table" style="width: 250%">
                            <table id="myTable" class="tablesorter">
                                <thead>
                                    <tr>
                                        <th style="width: 2.5%;">
                                            STT
                                        </th>
                                        @*<th style="width: 4%;">
                                        </th>*@
                                        @*<th style="width: 1%;">
                                        </th>*@
                                        <th style="width: 4%;">
                                            
                                        </th>
                                        @*<th style="width: 8%;">
                                            Dslam
                                        </th>*@
                                        <th style="width: 3%;">
                                            Cổng
                                        </th>
                                        <th style="width: 6.2%;">
                                            @if (ViewBag.dslam_type==1)
                                            {
                                                <text>R/S |</text>
                                            }
                                            S/P | Vpi/Vci
                                        </th>
                                        <th style="width: 6.3%;">
                                            Account Mytv
                                        </th>
                                        <th style="width: 8%;">
                                            Gói DV Mytv
                                        </th>
                                        <th style="width: 7%;">
                                            Account Internet
                                        </th>
                                        <th style="width: 6.3%;">
                                            Gói DV Internet
                                        </th>
                                        <th style="width: 6.5%;">
                                            Hình thức Internet
                                        </th>
                                        <th style="width: 5%;">
                                            Mã KH
                                        </th>
                                        <th style="width: 10%;">
                                            Tên KH
                                        </th>
                                        @*<th style="width: 4%;">
                                            Trạng thái
                                        </th>*@
                                        <th>
                                            Địa chỉ
                                        </th>
                                        @*<th>
                                            Ngày ĐK
                                        </th>*@ @*<th style="width:130px;">Họ tên</th>*@
                                    </tr>
                                </thead>
                                <tbody>
                                    @{int stt = 0;}
                                    @foreach (var item in Model)
                                    {
                                        stt++;
                                        <tr>
                                            <td class="align-center">@stt
                                            </td>
                                            @*<td>
                                                @if (item.status != "2")
                                                {                                        
                                                    <a href="@Url.Action("RequestAction", "DslamPort", new { id = item.id, type = "bh" })" onClick="return confirm('Ban muon bao hong?')" title="Báo hỏng">
                                                        <img src="@Url.Content("~/Content/Body/Images/cross-on-white.gif")"  width="16" height="16" alt="edit" /></a><font>&nbsp;&nbsp;</font>
                                                    <a href="@Url.Action("RequestAction", "DslamPort", new { id = item.id, type = "dt" })" onClick="return confirm('Ban muon de trong?')" title="Để trống">
                                                        <img src="@Url.Content("~/Content/Body/Images/empty.png")"  width="16" height="16" alt="edit" /></a><font>&nbsp;&nbsp;</font>
                                                    <a href="@Url.Action("EditDslamPort", "DslamPort", new { id = item.id, system_id = item.system_id, quan_huyen_id = item.quan_huyen_id, select_status = ViewBag.find_select_status, select_option = ViewBag.find_selectbox, timkiem = ViewBag.find_textbox })" title="Cập nhật">
                                                        <img src="@Url.Content("~/Content/Body/Images/pencil.gif")"  width="16" height="16" alt="edit" /></a>
                                                }
                                                else
                                                { 
                                                    <font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
                                                    <a href="@Url.Action("RequestAction", "DslamPort", new { id = item.id, type = "kp" })" onClick="return confirm('Ban muon khoi phuc?')" title="Khôi phục">
                                                        <img src="@Url.Content("~/Content/Body/Images/dongbo.jpg")"  width="18" height="18" alt="edit" /></a><font>&nbsp;&nbsp;</font>
                                                }
                                            </td>*@
                                            @if (item.status == "0")
                                            { 
                                                <td style="background: yellow">
                                                    Trống
                                                </td>
                                            }
                                            else if (item.status == "1")
                                            {
                                                <td>
                                                    Đã dùng
                                                </td>
                                            }
                                            else
                                            {
                                                <td style="background: red">
                                                    Hỏng
                                                </td>
                                            }
                                            @*<td>@Html.DisplayFor(modelItem => item.name)
                                            </td>*@
                                            <td>@Html.DisplayFor(modelItem => item.cong)
                                            @if (item.dung_luong.Length > 0)
                                            {
                                                <text>(@item.dung_luong.Replace("DSL",""))</text>
                                            }
                                            </td>
                                            <td>
                                                @if (ViewBag.dslam_type==1)
                                                {
                                                    @Html.DisplayFor(modelItem => item.rackid)<text>/</text>@Html.DisplayFor(modelItem => item.selfid)
                                                    <text>|</text> 
                                                }@Html.DisplayFor(modelItem => item.slot)/@Html.DisplayFor(modelItem => item.port)
                                                | @Html.DisplayFor(modelItem => item.vpi)/@Html.DisplayFor(modelItem => item.vci)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.account_mytv)
                                            </td>
                                            <td>
                                                @Html.DisplayFor(modelItem => item.goidv_mytv)
                                                @if (item.trang_thai_mytv == "0")
                                                {
                                                    <text>/Khóa</text>
                                                }
                                                else if (item.trang_thai_mytv == "1")
                                                {
                                                    <text>/H.Động</text>
                                                }
                                                else if (item.trang_thai_mytv == "2")
                                                {
                                                    <text>/T.Ngưng</text>
                                                }
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.account_int)
                                            </td>
                                            <td>
                                                @Html.DisplayFor(modelItem => item.goidv_int)
                                                @if (item.trang_thai_int == "0")
                                                {
                                                    <text>/Khóa</text>
                                                }
                                                else if (item.trang_thai_int == "1")
                                                {
                                                    <text>/H.Động</text>
                                                }
                                                else if (item.trang_thai_int == "2")
                                                {
                                                    <text>/T.Ngưng</text>
                                                }
                                            </td>
                                            <td>
                                            @if (item.hinh_thuc_int == "0")
                                            {                                                
                                                    <text>Lưu lượng</text>                                             
                                            }
                                            else if (item.hinh_thuc_int == "1")
                                            {
                                                    <text>Trọn gói</text>                                                
                                            }
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.ma_kh)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.ten_kh)
                                            </td>
                                            @*<td>@Html.DisplayFor(modelItem => item.trang_thai_int)
                                            </td>*@
                                            <td>@Html.DisplayFor(modelItem => item.diachi_kh)
                                            </td>
                                            @*<td>@Html.DisplayFor(modelItem => item.ngay_dk_int)
                                            </td>*@
                                        </tr>
                                    }
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="pager" id="pager">
                        <div>
                            <img class="first" src="@Url.Content("~/Content/Body/Images/arrow-stop-180.gif")"  alt="first"/>
                            <img class="prev" src="@Url.Content("~/Content/Body/Images/arrow-180.gif")" alt="prev"/>
                            <input type="text" class="pagedisplay input-short align-center" />
                            <img class="next" src="@Url.Content("~/Content/Body/Images/arrow.gif")" alt="next"/>
                            <img class="last" src="@Url.Content("~/Content/Body/Images/arrow-stop.gif")" alt="last"/>
                            <select class="pagesize input-short align-center">
                                <option value="20" selected="selected">20</option>
                                <option value="30">30</option>
                                <option value="40">40</option>
                            </select>
                        </div>
                    </div>
                    <div style="clear: both">
                    </div>
                </div>
            </div> 
        }
    </div>
    <div style="clear: both;">
    </div>
</div>